package com.hwz.mapper;

import com.github.pagehelper.Page;
import com.hwz.annotation.AutoFill;
import com.hwz.dto.CategoryDTO;
import com.hwz.entity.Category;
import com.hwz.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CategoryMapper {
    Page<Category> page(String name, Integer type);

    @AutoFill(value = OperationType.UPDATE)
    void update(Category category);

    @AutoFill(value = OperationType.INSERT)
    void insert(Category category);

    List<Category> getByType(Integer type);

    void delete(Long id);

    String getName(Long categoryId);
}
